﻿<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:sys="clr-namespace:System;assembly=mscorlib"
      Title="Page Title">
    <Grid>
        <!--  Tolarent element, no break line in markup extension  -->
        <TextBlock Text="{Binding 
    RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Page}}, 
    Path=Title, StringFormat={}{0}Now{{0}} - {0}}" />

        <!--  Markup extension format  -->
        <!-- Literal style -->
        <TextBlock HorizontalAlignment="Center" 
               VerticalAlignment="Center"
               FontSize="20"
               Foreground="Red"
               Text="{Binding {}Title,
                              RelativeSource={RelativeSource FindAncestor,
                                                             AncestorType={x:Type Page}},
                              StringFormat={}{0}Now{{0}} - {0}}" />

        <TextBlock Text="{Binding Path=Content, ElementName=m_button, StringFormat={}{0:##\,#0.00;(##\,#0.00); }}" HorizontalAlignment="Right" VerticalAlignment="Top"/>


        <TextBlock Style="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
               Text="Foreground"
               x:Uid="Setter_75" />

        <TextBlock Style="{DynamicResource {x:Static SystemColors.ControlTextBrushKey},
                                       ResourceKey={x:Static SystemColors.ControlTextBrushKey}}"
               Text="Foreground"
               x:Uid="Setter_75" />

        <!-- Quoted Value -->
        <TextBlock Style="SomeStyle"
             Text="{Binding Path=U1State,
                            Converter={StaticResource Enum2BooleanConverter},
                            ConverterParameter='Adjustment,ToManualFromAdjustment,ToSemiAutoFromAdjustment,ToAutoFromAdjustment'}"
             x:Uid="Setter_87" />
        
        <TextBlock Text="{Binding Path=Text, ElementName=m_source, StringFormat='{}{0} , {0}'}" />
        
        <TextBlock Margin="40" Text="{Binding Path=Text, ElementName=m_source, StringFormat='a,b,{0}'}" />

        <TextBlock FontSize="18" FontWeight="Bold" Text="{Binding SelectedReceiver, StringFormat='{}{0}\'s email'}" />

        <!--  Escape Sequence  -->
        <TextBlock x:Name="m_text" 
               Margin="20, 5"
               HorizontalAlignment="Center"
               VerticalAlignment="Bottom"
               FontSize="20"
               Foreground="Green"
               Text="{}{asdfg}   " />

        <!--  Xml Namespace  -->
        <TextBlock Width="100" Text="{Binding Path=Element[{http://planetsNS}DiameterKM].Value}" />
        <TextBlock Width="100" Text="{Binding Path=Attribute[Name].Value}" />
        <TextBlock Margin="20, 5" 
               HorizontalAlignment="Center"
               VerticalAlignment="Bottom"
               Text="{Binding Path=Element[{http://planetsNS}Details].Value,
                              Source={}{{Test}}}" />

    </Grid>
</Page>